#include "currency.h"

using namespace std;

int main() {
  Currency g, h(SignType::plus, 3, 50), i, j;

  g.SetValue(SignType::minus, 2, 25);
  i.SetValue(-6.45);

  j = h + g;

  cout << "j = h + g = " << h << " + " << g << " = " << j << endl;

  j = i + g + h;
  cout << "j = i + g + h = " << i << " + " << g << " + "
       << h << " = " << j << endl;

  j = (i += g) + h;

  cout << "j = (i += g) + h = (" << i << " += " << g << ") +"
       << h << " = " << j << endl;
  cout << "i is " << i << endl;

  //test abnormal
  cout << "Attempting to initialize with cents = 152" << endl;
  try {
    i.SetValue(SignType::plus, 3, 152);
  }
  catch (IllegalParameterValue e) {
    cout << "Caught thrown exception" << endl;
    e.OutputMessage();
  }
  return 0;
}
